package cn.com.zetatech.hdjc.api;

import cn.com.zetatech.hdjc.entity.Hello;
import cn.com.zetatech.api.common.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;


import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Api(value = "HELLOSERVICE", tags = {"hello服务api"})
@RequestMapping("hellos")
@FeignClient("HDJC-SERVICE")
public interface HelloService {

    @ApiOperation(value = "", notes = "创建Hello")
    @PostMapping("")
    Result<Hello> save(@Validated @RequestBody Hello t);

    @ApiOperation(value = "", notes = "更新Hello")
    @PutMapping("{id}")
    Result<Hello> update(@PathVariable(value = "id") String id, @Validated @RequestBody Hello t);

    @ApiOperation(value = "", notes = "根据id获取Hello实体信息")
    @GetMapping("{id}")
    Result<Hello> get(@PathVariable(value = "id", required = true) String id);


    @ApiOperation(value = "", notes = "根据id删除删除Hello信息")
    @DeleteMapping("{id}")
    Result<Hello> delete(@PathVariable(value = "id", required = true) String id);
}

